﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Hfm.Common.Entity.Contacts;
using Hfm.Core.DataAccess.Customer;


namespace Hfm.Core.BusinessManager.Customer
{
    public class ContactsManager
    {
        protected readonly ContactsData ContactsDataAccess;

        public ContactsManager()
        {
            
        }

        public ContactsManager(ContactsData contacts)
        {
            ContactsDataAccess = contacts;
        }
        /// <summary>
        /// 得到联系人
        /// </summary>
        /// <returns></returns>
        public virtual IList<NewContactsEntity> GetContacts()
        {
            return ContactsDataAccess.GetContacts();
        }
        /// <summary>
        /// 通过ID得到联系人
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public virtual NewContactsEntity GetContactsByID(int ID)
        {
            return ContactsDataAccess.GetContactsByID(ID);
        }
        /// <summary>
        /// 根据顾客ID查找联系人
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public virtual IList<NewContactsEntity> GetContactsByCID(int CID)
        {
            return ContactsDataAccess.GetContactsByCID(CID);
        }

        /// <summary>
        /// 根据顾客ID查找联系人
        /// </summary>
        /// <param name="CID"></param>
        /// <returns></returns>
        public virtual IList<ContactsEntity> GetContactsByCustomerID(int CID)
        {
            return ContactsDataAccess.GetContactsByCustomerID(CID);
        }

        /// <summary>
        /// 创建联系人
        /// </summary>
        /// <param name="Contacts"></param>
        public virtual void CreateContacts(ContactsEntity Contacts)
        {
            ContactsDataAccess.CreateContacts(Contacts);
        }
        /// <summary>
        /// 更新联系人
        /// </summary>
        /// <param name="Contacts"></param>
        public virtual void UpdateContacts(ContactsEntity Contacts)
        {
            ContactsDataAccess.UpdateContacts(Contacts);
        }
        /// <summary>
        /// 删除联系人
        /// </summary>
        /// <param name="ID"></param>
        public virtual void DeleteContacts(int ID)
        {
            ContactsDataAccess.DeleteContacts(ID);
        }
        /// <summary>
        /// 根据顾客删除联系人
        /// </summary>
        /// <param name="ID"></param>
        public virtual void DeleteContactsByCID(int CID)
        {
            ContactsDataAccess.DeleteContactsByCID(CID);
        }
    }
}
